package dico.game.wordFinder;

import java.io.File;
import java.io.IOException;
import java.util.List;

import dico.finder.DicoAnalyser;
import dico.finder.Word;
import dico.finder.impl.DicoToWordFactory;

public class Main {
	
	
	public static void main(String[] args) throws IOException {
//		long before_ana = System.currentTimeMillis();
//		DicoAnalyser analyser = new DicoAnalyser(new DicoToWordFactory(), new File("E:\\Google Drive\\DICOTOT.TXT"));
//		System.out.println("ANALYSE : "+(System.currentTimeMillis()-before_ana));
//		
//		long before = System.currentTimeMillis();
//		boolean find = analyser.contains("à");
//		System.out.println("TEMPS DE RECHERCHE : "+(System.currentTimeMillis()-before)+"ms");
//		System.out.println("FIND : "+find);
//		
//		/** test the anagrame */
//		long before3 = System.currentTimeMillis();
//		List<Word> words = analyser.getAllWord("attention");
//		System.out.println("TIME  : "+(System.currentTimeMillis()-before3)+"ms");
//		
//		for (Word word : words) {
//			System.out.println(word);
//		}
//		
//		long before4 = System.currentTimeMillis();
//		List<Word> words_news = analyser.getWordBeginBy("aTt");
//		System.out.println("TIME  : "+(System.currentTimeMillis()-before4)+"ms");
//		
//		for (Word word : words_news) {
//			System.out.println(word);
//		}
		
		DicoAnalyser analyser = new DicoAnalyser(new DicoToWordFactory(), new File("E:\\Google Drive\\DICOTOT.TXT"));
		
		GameGrid grid = new GameGrid(5, 5, analyser);
		System.out.println(grid);
		List<Word> all_word = grid.getAllWord();
		for (Word word : all_word) {
			System.out.println(word);
		}
		System.out.println("FIN");
	}
}
